package com.adou.second.day6;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;


/**
 * 泛型
 * @author admin
 *
 */
public class GenaricDemo {

	public static void main(String[] args) {
//		Collection c = new ArrayList(); 
//		c.add("Java");
//		c.add("C#");
//		c.add("Python");
//		
//		Iterator it = c.iterator();
//		while(it.hasNext()){
//			String itStr = (String) it.next();
//			System.out.println("itStr:" + itStr);
//		}
		
		
		Collection<String> c = new ArrayList<String>(); 
		c.add("Java");
		c.add("C#");
		c.add("Python");
		
		Iterator<String> it = c.iterator();
		while(it.hasNext()){
			String itStr = it.next();
			System.out.println("itStr:" + itStr);
		}
		
	}
	


}
